/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;

/**
 * <p>Project: javase - Ex4
 * <p>Powered by webrx On 2021-11-24 10:24:31
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex4 {
    public static void main(String[] args) {
        var c = Calendar.getInstance();
        var h = c.get(Calendar.HOUR_OF_DAY);
        //早上 5-8  上午 8-12 中午　12-14 下午　14-18 晚上 18-23 0-2 午夜 3-5 凌晨
        h = 21;
        if (h >= 5 && h < 8) {
            System.out.println("早上好");
        } else if (h >= 8 && h < 12) {
            System.out.println("上午好");
        } else if (h >= 12 && h < 14) {
            System.out.println("中午好");
        } else if (h >= 14 && h < 18) {
            System.out.println("下午好");
        } else if (h >= 18 && h <= 23) {
            System.out.println("晚上好");
        } else if (h >= 0 && h < 3) {
            System.out.println("午夜，多注意身体");
        } else if (h >= 3 && h < 5) {
            System.out.println("凌晨好");
        }
    }
}
